import { useRequest } from "../../../utils/request";

Component({
    data: {},
    observers: {
        'data': function (data) {
            const app = getApp()
            app.messageNumber = data.system_msg_num + data.owner_msg_num + data.order_msg_num
            this.getTabBar().init();
        }
    },
    methods: {
        onLoad() {
            this.request = new useRequest('api/usermsgalreadyread', { data: 'data', hold: true }, this)
        },
        onShow() {
            this.request.run()
            this.getTabBar().init();
        },
        async onPullDownRefresh() {
            await this.request.run()
            wx.stopPullDownRefresh()
        }
    }
})
